{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "xy4LeDEn7hQM"
   },
   "source": [
    "# 🧠 Cognitive Assistant Agent Team (PraisonAI)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "ElVhkoB37j8Y"
   },
   "source": [
    "This notebook demonstrates a multi-specialist cognitive assistant using PraisonAI, with each specialist as a tool."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "WKiORZL790Fj"
   },
   "source": [
    "[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/DhivyaBharathy-web/PraisonAI/blob/main/examples/cookbooks/Intelligent_Cognitive_Agent.ipynb)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "7l3cAapx7phr"
   },
   "source": [
    "# Install Dependencies"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "id": "oHrh082q86Pp"
   },
   "outputs": [],
   "source": [
    "!pip install praisonaiagents"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "AnA-11hm9R4z"
   },
   "source": [
    "# Set API Key"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "id": "n1Fz52T489HE"
   },
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "# Set your OpenAI or OpenRouter API key for PraisonAI\n",
    "os.environ['OPENAI_API_KEY'] = 'Enter your api key'  # <-- Replace with your actual OpenAI or OpenRouter API key"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "bGbZXPS29XJ-"
   },
   "source": [
    "# Imports and Specialist Agent Definitions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "id": "7MzNN_u_9DKL"
   },
   "outputs": [],
   "source": [
    "import re\n",
    "from praisonaiagents import Agent\n",
    "\n",
    "# Dummy specialist agent classes for demonstration.\n",
    "# Replace these with your actual specialist agent logic if needed.\n",
    "class SpecialistAgent:\n",
    "    def __init__(self, name):\n",
    "        self.name = name\n",
    "    def run(self, query):\n",
    "        return f\"{self.name} specialist response to: {query}\"\n",
    "\n",
    "# Instantiate all specialist agents (replace with your real classes if available)\n",
    "specialists = [\n",
    "    SpecialistAgent(\"decision_risk_agent\"),\n",
    "    SpecialistAgent(\"problem_solving_innovation_agent\"),\n",
    "    SpecialistAgent(\"Systems___Complexity_Agent\"),\n",
    "    SpecialistAgent(\"bias_psychology_agent\"),\n",
    "    SpecialistAgent(\"Strategy___Competition_Agent\"),\n",
    "    SpecialistAgent(\"Learning___Communication_Agent\"),\n",
    "    SpecialistAgent(\"Efficiency___Process_Agent\"),\n",
    "    SpecialistAgent(\"motivation_human_factors_agent\"),\n",
    "]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "efcGipcd9bNL"
   },
   "source": [
    "# Tool Wrapping and Agent Setup"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "id": "-rotrhkh9FmF"
   },
   "outputs": [],
   "source": [
    "def make_tool(agent):\n",
    "    def tool(query: str):\n",
    "        return agent.run(query)\n",
    "    # Sanitize the tool name to match PraisonAI's requirements\n",
    "    safe_name = re.sub(r'[^a-zA-Z0-9_-]', '_', agent.name or \"tool\")\n",
    "    tool.__name__ = safe_name\n",
    "    return tool\n",
    "\n",
    "tools = [make_tool(agent) for agent in specialists]\n",
    "\n",
    "agent = Agent(\n",
    "    instructions=\"\"\"\n",
    "        You are a cognitive assistant with access to a set of specialist tools (decision making, problem solving, systems thinking, psychology, strategy, learning, efficiency, motivation).\n",
    "        Use the most relevant tool(s) to answer the user's query.\n",
    "    \"\"\",\n",
    "    tools=tools,\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "uZp3cCBs9fMS"
   },
   "source": [
    "# User Query and Agent Response"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 777,
     "referenced_widgets": [
      "5112c2c89e944d99a9bfbe35d7186a96",
      "8dd112d60a6148e3b6cce31d7fb4eb0f"
     ]
    },
    "id": "VhcEo-2q9HSv",
    "outputId": "8bf73c8a-4d0d-47dd-b151-a2a49c79b1f8"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ask your question (or type 'quit' to exit): hi\n",
      "\n",
      "--- Thinking ---\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╭─ </span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8; font-weight: bold\">Agent Info</span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\"> ────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #ff9b9b; text-decoration-color: #ff9b9b; font-weight: bold\">👤 Agent:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Agent</span>                                                                                                <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #b4b4b3; text-decoration-color: #b4b4b3; font-weight: bold\">Role:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Assistant</span>                                                                                                <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #86a789; text-decoration-color: #86a789; font-weight: bold\">Tools:</span> <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">decision_risk_agent</span>, <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">problem_solving_innovation_agent</span>, <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">Systems___Complexity_Agent</span>,                      <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">bias_psychology_agent</span>, <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">Strategy___Competition_Agent</span>, <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">Learning___Communication_Agent</span>,                           <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">Efficiency___Process_Agent</span>, <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">motivation_human_factors_agent</span>                                                     <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;210;227;200m╭─\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[1;38;2;210;227;200mAgent Info\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[38;2;210;227;200m───────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;210;227;200m─╮\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;255;155;155m👤 Agent:\u001b[0m \u001b[38;2;255;229;229mAgent\u001b[0m                                                                                                \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;180;180;179mRole:\u001b[0m \u001b[38;2;255;229;229mAssistant\u001b[0m                                                                                                \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;134;167;137mTools:\u001b[0m \u001b[3;38;2;180;212;255mdecision_risk_agent\u001b[0m, \u001b[3;38;2;180;212;255mproblem_solving_innovation_agent\u001b[0m, \u001b[3;38;2;180;212;255mSystems___Complexity_Agent\u001b[0m,                      \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[3;38;2;180;212;255mbias_psychology_agent\u001b[0m, \u001b[3;38;2;180;212;255mStrategy___Competition_Agent\u001b[0m, \u001b[3;38;2;180;212;255mLearning___Communication_Agent\u001b[0m,                           \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[3;38;2;180;212;255mEfficiency___Process_Agent\u001b[0m, \u001b[3;38;2;180;212;255mmotivation_human_factors_agent\u001b[0m                                                     \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">Response generated in 1.5s</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2mResponse generated in 1.5s\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> hi                                                                                                              <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m hi                                                                                                              \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Hello! How can I assist you today?                                                                              <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m Hello! How can I assist you today?                                                                              \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hello! How can I assist you today?\n",
      "\n",
      "---------------\n",
      "Ask your question (or type 'quit' to exit): exit\n",
      "\n",
      "--- Thinking ---\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╭─ </span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8; font-weight: bold\">Agent Info</span><span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\"> ────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #ff9b9b; text-decoration-color: #ff9b9b; font-weight: bold\">👤 Agent:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Agent</span>                                                                                                <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #b4b4b3; text-decoration-color: #b4b4b3; font-weight: bold\">Role:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Assistant</span>                                                                                                <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #86a789; text-decoration-color: #86a789; font-weight: bold\">Tools:</span> <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">decision_risk_agent</span>, <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">problem_solving_innovation_agent</span>, <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">Systems___Complexity_Agent</span>,                      <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">bias_psychology_agent</span>, <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">Strategy___Competition_Agent</span>, <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">Learning___Communication_Agent</span>,                           <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>  <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">Efficiency___Process_Agent</span>, <span style=\"color: #b4d4ff; text-decoration-color: #b4d4ff; font-style: italic\">motivation_human_factors_agent</span>                                                     <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>                                                                                                                 <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n",
       "<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[38;2;210;227;200m╭─\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[1;38;2;210;227;200mAgent Info\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[38;2;210;227;200m───────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;210;227;200m─╮\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;255;155;155m👤 Agent:\u001b[0m \u001b[38;2;255;229;229mAgent\u001b[0m                                                                                                \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;180;180;179mRole:\u001b[0m \u001b[38;2;255;229;229mAssistant\u001b[0m                                                                                                \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[1;38;2;134;167;137mTools:\u001b[0m \u001b[3;38;2;180;212;255mdecision_risk_agent\u001b[0m, \u001b[3;38;2;180;212;255mproblem_solving_innovation_agent\u001b[0m, \u001b[3;38;2;180;212;255mSystems___Complexity_Agent\u001b[0m,                      \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[3;38;2;180;212;255mbias_psychology_agent\u001b[0m, \u001b[3;38;2;180;212;255mStrategy___Competition_Agent\u001b[0m, \u001b[3;38;2;180;212;255mLearning___Communication_Agent\u001b[0m,                           \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m  \u001b[3;38;2;180;212;255mEfficiency___Process_Agent\u001b[0m, \u001b[3;38;2;180;212;255mmotivation_human_factors_agent\u001b[0m                                                     \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m│\u001b[0m                                                                                                                 \u001b[38;2;210;227;200m│\u001b[0m\n",
       "\u001b[38;2;210;227;200m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5112c2c89e944d99a9bfbe35d7186a96",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">Response generated in 1.2s</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[2mResponse generated in 1.2s\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> exit                                                                                                            <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m exit                                                                                                            \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008080; text-decoration-color: #008080\">╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">│</span> If you have any more questions in the future, feel free to ask. Have a great day! Goodbye!                      <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n",
       "<span style=\"color: #008080; text-decoration-color: #008080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
       "\u001b[36m│\u001b[0m If you have any more questions in the future, feel free to ask. Have a great day! Goodbye!                      \u001b[36m│\u001b[0m\n",
       "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "If you have any more questions in the future, feel free to ask. Have a great day! Goodbye!\n",
      "\n",
      "---------------\n",
      "Ask your question (or type 'quit' to exit): quit\n",
      "Cognitive Assistant Agent Team - Finished.\n"
     ]
    }
   ],
   "source": [
    "user_query = input(\"Ask your question (or type 'quit' to exit): \")\n",
    "while user_query.lower() != 'quit':\n",
    "    print(\"\\n--- Thinking ---\")\n",
    "    response = agent.start(user_query)\n",
    "    print(response)\n",
    "    print(\"\\n---------------\")\n",
    "    user_query = input(\"Ask your question (or type 'quit' to exit): \")\n",
    "print(\"Cognitive Assistant Agent Team - Finished.\")"
   ]
  }
 ],
 "metadata": {
  "colab": {
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3",
   "name": "python3"
  },
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
